package com.wsjj.yjh.server.impl;

import com.wsjj.yjh.bean.FlumeDataxMaxwellSqoopFlinkCDCTable;
import com.wsjj.yjh.bean.HadoopTable;
import com.wsjj.yjh.mapper.FlumeDataxMaxwellSqoopFlinkCDCTableMapper;
import com.wsjj.yjh.mapper.HadoopTableMapper;
import com.wsjj.yjh.server.FlumeDataxMaxwellSqoopFlinkCDCTableServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class FlumeDataxMaxwellSqoopFlinkCDCTableServerImpl implements FlumeDataxMaxwellSqoopFlinkCDCTableServer {
    @Autowired
    private FlumeDataxMaxwellSqoopFlinkCDCTableMapper flumeDataxMaxwellSqoopFlinkCDCTableMapper;

    @Override
    public FlumeDataxMaxwellSqoopFlinkCDCTable selectById() {
        Integer coumt = flumeDataxMaxwellSqoopFlinkCDCTableMapper.selectCoumt();

        Random random = new Random();
        int id = random.nextInt(coumt);

        return flumeDataxMaxwellSqoopFlinkCDCTableMapper.selectById(id+1);
    }
}
